<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	UserBean user = (UserBean)request.getSession().getAttribute("userBean");
	String _db = user.getDbType();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<title>重点服务对象逾期提醒规则修改</title>
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />

		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/validata.js"></script>

		<script type="text/javascript" src="ligerUI/js/plugins/ligerGrid.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerTree.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerForm.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerDateEditor.js"></script>
		
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.validate.min.js" ></script> 
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.metadata.js"></script>
		<script type="text/javascript" src="ligerUI/jquery-validation/messages_cn.js" ></script>
		
<script type="text/javascript">
var _db = '<%=_db%>';

_jsonObj.classname = "com.wxtf.platform.main.keyserobj.SystemSetTimeRole";
_jsonObj.methodname = "queryPage";
_jsonObj.logicdata = "";

var win;//初始化
var manager;//表格

$(function(){
	manager = $("#emp-grid").ligerGrid({
		url: _url, parms: _jsonObj, width: '100%', height: '100%',
		usePager: true, rownumbers: true, checkbox: false, alternatingRow: true,enabledSort:false,
		columns: [
			{ display: '主键', name: 'SC_UUID',width:1,hide:true },
			{ display: '用户id', name: 'SC_UID',width:1,hide:true },			
			{ display: '字典名称（季度）', name: 'SC_KEY',width:130,
			       render: function(record, index, value, oth){         
						if (value=="1")
						{return "第一季度";}
						else if (value =="2")
						{return "第二季度";}
						else if ( value=="3")
						{return "第三季度";}
						else if (value =="4")
						{return "第四季度";}
				}
			   },			
			{ display: '字典值（月-日）', name: 'SC_VALUE',width:130 },
			{ display: '是否有效', name: 'SC_MARKED',width:100 ,
			         render: function(record, index, value, oth){         
						if (value=="1")
						{return "是";}
						else if (value =="0")
						{return "否";}
						
				}
			},
			{ display: '创建/修改时间', name: 'SC_WRITE_TIME',width:1,hide:true }
			   
		],
		toolbar: {
			items: [
				{ text: '初始化设置', click: function(){ set_f(); }, icon: 'save' },
				// { line: true },
				{ text: '逾期提醒规则修改', click: function(){ role_openwindow(); }, icon: 'save' }
				// { line: true }	
			]	
		}
	});
});

       //设置初始值
       function set_f()
       {
           var param_set_f = { 
				"classname": "com.wxtf.platform.main.keyserobj.SystemSetTimeRole",
				"methodname": "set_f",
				"logicdata": "[]",
				"extenddata": "[]"
			};
			callserver(param_set_f,function(data, satus){
						if(data.result || data.result == 'true'){
							succMsgTip(data.resultrecord);
						}else{
							warningTip(data.resultrecord);
						}
						reload();
					},function(data, satus){
						warningTip(data.resultrecord);
					});
       }

		//打开窗口
       	var win;        
        function f_openWindow(target, title, width, height, func, func2) {
			if(win==null){
            	win = initWindowByDiv(target, title, width, height, func, func2);
			}else{
				win.show();
			}
       	}
       	
       	
		//整体规则
       function role_openwindow(){
			document.getElementById('xiugai-Form').reset();
			var param = { 
				"classname": "com.wxtf.platform.main.keyserobj.SystemSetTimeRole",
				"methodname": "update",
				"logicdata": "[]",
				"extenddata": "[]"
			};
			f_openWindow('xiugai-div', '逾期提醒规则修改', 400, 150 ,function()
		    {	
		            var role_yue = $("#role_yue").val();	 //月	
					var role_ri = $("#role_ri").val();    //日
					param.logicdata = '[{"role_yue":"'+role_yue+'","role_ri":"'+role_ri+'"}]';
					callserver(param,function(data, satus){
						if(data.result || data.result == 'true'){
							succMsgTip(data.resultrecord);
						}else{
							warningTip(data.resultrecord);
						}
						reload();
						win.hide();
					},function(data, satus){
						warningTip(data.resultrecord);
					});
			}, 
			function()
			{
				win.hide();
			}
			);
		}

		//表格刷新
		function reload(){
			_jsonObj.methodname = "queryPage";
			_jsonObj.logicdata = "[{\"types\":\"init\"}]";
			manager.loadData();
		}

</script>
	</head>
	  <body>
		<div id="emp-grid"></div>
		
    	<div id="xiugai-div" style="display:none;">
			<form id="xiugai-Form">
			    <input type="hidden" id="tesvrt_id" name="tesvrt_id" value="" />
				<input type="hidden" id="tbfi_id" name="tbfi_id" value="" />
				<input type="hidden" id="tesvrt_time" name="tesvrt_time" value="" />
			    <input type="hidden" id="reserve1" name="reserve1" value="" />
				<input type="hidden" id="reserve2" name="reserve2" value="" />
				<input type="hidden" id="reserve3" name="reserve3" value="" />
				<input type="hidden" id="reserve4" name="reserve4" value="" />
				<input type="hidden" id="reserve5" name="reserve5" value="" />
				<input type="hidden" id="create_by" name="create_by" value="" />
				<input type="hidden" id="create_time" name="create_time" value="" />
				<input type="hidden" id="last_modify_by" name="last_modify_by" value="" />
				<input type="hidden" id="last_modify_time" name="last_modify_time" value="" />
				<table class="form_table">
                    <tr>
					    <td>提醒规则修改为：
						   <select name="role_yue" id="role_yue"  >
                            <option value="1">每季度首月</option>
                            <option value="2">每季度次月</option>
                            <option value="3">每季度末月</option>
                            </select>
                            <select name="role_ri" id="role_ri"  >
                            <option value="01">1</option>
                            <option value="02">2</option>
                            <option value="03">3</option>
                            <option value="04">4</option>
                            <option value="05">5</option>
                            <option value="06">6</option>
                            <option value="07">7</option>
                            <option value="08">8</option>
                            <option value="09">9</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                            <option value="24">24</option>
                            <option value="25">25</option>
                            <option value="26">26</option>
                            <option value="27">27</option>
                            <option value="28">28</option>
                            <option value="29">29</option>
                            <option value="30">30</option>
                            <option value="31">31</option>
                            </select>
                        日提醒</td>		
					</tr>
					<tr >	
					<td></td>	
					</tr>	
				</table>
			</form>			
		</div>
			
	</body>
</html>

